import 'package:enterprise_v6_app/app/components/custom_app_bar.dart';
import 'package:enterprise_v6_app/app/components/dialog/exit_tips.dart';
import 'package:enterprise_v6_app/app/core/core.dart';
import 'package:enterprise_v6_app/app/core/ext/widget_extension.dart';
import 'package:enterprise_v6_app/app/modules/application/emergency/common/drill_process/drill_process_view.dart';
import 'package:enterprise_v6_app/app/modules/task/task_all/task_emergency/task_drill_plan/drill_plan_execute/drill_plan_execute_controller.dart';

/// 我的任务-敏捷应急-演练计划执行
class DrillPlanExecutePage extends StatelessWidget {
  DrillPlanExecutePage({super.key});

  final controller = Get.put(DrillPlanExecuteController());

  @override
  Widget build(BuildContext context) {
    return GetBuilder(
        init: controller,
        builder: (_) {
          return Scaffold(
              appBar: CustomAppBar(titleText: '计划名称'),
              body: Container(
                padding: EdgeInsets.only(top: 10.w),
                margin: EdgeInsets.only(bottom: 40.w),
                color: const Color(0xffF5F5F6),
                child: DrillProcessPage(exercisePlanId: controller.id, isEnabled: true),
              ),
              bottomSheet: _getBottomSheetView());
        });
  }

  Widget _getBottomSheetView() {
    return Container(
      height: 50.w,
      alignment: Alignment.center,
      padding: EdgeInsets.symmetric(horizontal: 16.w),
      decoration: BoxDecoration(
        color: Colors.white,
        boxShadow: [
          BoxShadow(
            color: const Color(0xffBCBCC5).withOpacity(0.3), // 阴影颜色
            offset: const Offset(0, -5), // 阴影的偏移量，向上偏移，即上方阴影
            blurRadius: 10.0, // 阴影的模糊半径
            spreadRadius: 2.0, // 阴影的扩散半径
          ),
        ],
      ),
      child: Container(
          height: 40.w,
          alignment: Alignment.center,
          decoration: BoxDecoration(
            color: const Color(0xff5C6DFF),
            borderRadius: BorderRadius.all(Radius.circular(20.w)),
          ),
          child: Text(
            '提交',
            style: TextStyle(
              fontSize: 16.sp,
              color: const Color(0xffffffff),
            ),
          )).clickOnce(() {
        // 弹窗提示
        Get.dialog<bool>(ExitTips(
          content: '确认提交？',
          func: (b) {
            if (b) {
              Get.back();
            }
          },
        ));
      }),
    );
  }
}
